package com.kevin.j2eeToolBox.io.file;

import java.io.File;
import java.io.FilenameFilter;

public class FileTest3 {
	public static void main(String[] args) {
		File file = new File("D://test");

		// File[] fileList = file.listFiles();

		File[] fileList = file.listFiles(new FilenameFilter() {

			@Override
			public boolean accept(File dir, String name) {

				if (name.endsWith(".pdf")) {
					return true;

				} else {
					return false;
				}
			}
		});

		for (File item : fileList) {
			System.out.println(item.getName());
		}
	}
}
